package com.buka.common;

import lombok.Getter;

/**
 * 业务相关枚举类
 */
public enum BizCodeEnum {

    // 通用操作码
    OPS_REPEAT(110001, "重复操作"),

    /**
     * 验证码
     */
    CODE_TO_ERROR(240001, "接收号码不合规"),
    CODE_LIMITED(240002, "验证码发送过快"),
    CODE_ERROR(240003, "验证码错误"),
    CODE_CAPTCHA(240101, "图形验证码错误"),

    /**
     * 账号
     */
    ACCOUNT_REPEAT(250001, "账号已经存在"),
    ACCOUNT_UNREGISTER(250002, "账号不存在"),
    ACCOUNT_PWD_ERROR(250003, "账号或者密码错误"),

    MAIL_ERR(250004, "邮箱地址不合法"),
    NOT_LOGIN(250401, "请重新登录"),
    DIFF_ADDR(250404, "异地登录，拒绝访问！"),


    /**
     * 优惠券
     */
    COUPON_NOT_EXIST(270001, "没有优惠券"),
    COUPON_NO_STOCK(270002, "库存不足"),
    COUPON_GET_FAIL(270003, "优惠券领取失败"),
    COUPON_OUT_OF_TIME(270004, "优惠券不在领取时间内"),
    COUPON_OUT_OF_LIMIT(270005, "已达到数量限制"),
    COUPON_NO_USE(270006, "优惠券已被使用或过期"),
    LOCK_COUPON_ERROR(270007,"优惠券锁定失败" ),


    //商品相关
    NOT_PRODUCT(280001, "商品不存在"),


    ORDER_ERROR(290001, "订单异常"),

    NO_PAY(290002, "暂不支持此种支付方式"),
    NO_ORDER(290003, "订单不存在"),
    REDUCE_ERR(290004, "库存不足");


    @Getter
    private String message;
    @Getter
    private int code;

    private BizCodeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }


}


